Physics 3180: Thermal Physics

Computational Aid:

Computer Problems in "An Introduction to Thermal Physics"by Daniel V. Schroeder (Addison Wesley Longman, 1999)

This document gives software-specific information on solving problems in the book that require the use of a computer, typically Spreadsheet Problems (making tables, etc.).
 
Several problems in the book (mostly in chapters 2 and 3) ask you to make tables of multiplicities and related quantities for systems of up to a few hundred particles. These tables, and the graphs that go with them, are most conveniently made in a computer spreadsheet program. However, most spreadsheet programs will overflow on several of the exercises in the book if you try to compute the multiplicities in terms of factorials. Instead, you need to use the built-in function to compute "combinations" (defined on page 51). Both Microsoft Excel and Corel QuattroPro have such a function.
 

In Excel: The function you need is called "COMBIN". To compute the number of combinations of 20 objects chosen from 100, or "100 choose 20", you would type "=COMBIN(100,20)", for instance. To compute the multiplicity of an Einstein solid with 100 oscillators and 50 units of energy, you would type "=COMBIN(50+100-1,50)".
 

In QuattroPro:
The function you need is called "MULTINOMIAL". To compute the number of combinations of 20 objects chosen from 100, or "100 choose 20", you would type "=MULTINOMIAL(20,80)", for instance. (Note that 80 is 100 minus 20.) To compute the multiplicity of an Einstein solid with 100 oscillators and 50 units of energy, you would type "=MULTINOMIAL(50,100-1)".
 

Plotting Functions: You can plot a formula using a spreadsheet, by generating the data to plot in two columns and then creating a graph of these columns. This gets the job done, but it is tedious and doesn't produce the prettiest output. Graphing calculators are very convenient for plotting formulas, but usually are not connected to printers. I therefore recommend learning a more sophisticated software package such as MathCad, Maple, or Mathematica.
 


In Mathematica: The basic plotting function is Plot[ ], and the syntax is:
Plot[Exp[-x^2],{x,-3,3}]
This instruction generates a plot of the Gaussian function exp(-x2) for values of x ranging from -3 to 3.

Note that all Mathematica functions are case-sensitive, and that built-in functions such as Plot and Exp always start with capital letters. There are an enormous number of variations on the basic Plot function, which you can learn by reading Section 1.9 of The Mathematica Book.


Numerical Calculations: Before performing a numerical calculation it's usually a good idea to plot the relevant function(s) and estimate the answer graphically. Otherwise it's much too easy to get a wrong answer and not realize it.

Many scientific calculators can handle numerical integrals and root finding; just be sure to write down exactly what you punched into the calculator, in case you need to check for errors later.

Numerical calculations in Mathematica: are easy.

The numerical integration function is NIntegrate; here is an example:
NIntegrate[x^2*Exp[-x^2],{x,0,.5}]
The syntax is exactly the same as for the Plot function, with the list in curly braces specifying the integration variable and the beginning and ending values.

Root Finding: To solve a transcendental equation, use the FindRoot function:
FindRoot[Tanh[x]==x/2,{x,1.5}]
Note the double = sign in the equation to solve. The number 1.5 tells Mathematica where to start looking for a solution (since there may be more than one); in this case the function returned 1.91501.


The Texbook Author's WEB-site: http://physics.weber.edu/thermal/computer.html